import {
	defineStore
} from "pinia"

export const useTabbar = defineStore("tabbar", { //js命名
	state: () => {
		return {
			tabberIndex: uni.getStorageSync('tabberIndex') || 0 // 默认选中的索引
		}
	},
	actions: {
		// 给Tabber默认选中赋值
		changeTabberIndex(index) {
			uni.setStorageSync('tabberIndex', index)
			this.tabberIndex = index
		}
	}
})